<template>
  <ych-modal
    :fullscreen="true"
    :title="title || defaultTitle"
    :visible="visible"
    :destroyOnClose="true"
    @cancel="handleCancel">
    <bpm-task ref="bpmTask" :process-instance-id="processInstanceId"></bpm-task>

    <template slot="footer">
      <a-button key="close" @click="handleCancel">{{ $t('m.common.button.close') }}</a-button>
    </template>
  </ych-modal>
</template>

<script>

  import BpmTask from './bpmTrack/BpmTask'

  export default {
    name: 'BpmTaskDialog',
    components: {
      BpmTask
    },
    props: {
      title: {
        type: String,
        default: null
      },
      processInstanceId: {
        type: String,
        default: null
      }
    },
    data () {
      return {
        visible: false,
        defaultTitle: this.$t('m.bpm.other.showBpmTask')
      }
    },
    methods: {
      handleCancel () {
        this.visible = false
      },
    }
  }
</script>
